import React from 'react'
import {useLocation,useParams} from 'react-router-dom'
import qs from 'qs'
export default function Music() {
    const location = useLocation()
    const {id} = useParams()
    const Msg = qs.parse(location.search.split('?')[1])
    const {state}= location

  return (
    <div>
        歌手：{Msg.name}
        <br />
        编号：{id}
        <br />
        歌曲名称：
        <ul>
          {
            state.map(item=><li key={item.id}>{item.song}</li>)
          }
        </ul>
        
    </div>
  )
}
